<template>
  <div class="contirner">
    <slot name="nav-bar">
      <NavBar v-if="navbar"></NavBar>
    </slot>
    <ScrollList @refresh="onRefresh" @load="onLoad" :finshed="finshed">
      <slot></slot>
    </ScrollList>
    <slot name="tab-bar">
      <TabBar v-if="tabbar"></TabBar>
    </slot>
  </div>


</template>

<script setup>
import NavBar from '@/plugins/components/NavBar/index.vue';
import TabBar from '@/plugins/components/TabBar/index.vue';
import ScrollList from '@/plugins/components/ScrollList/index.vue';

import { useRoute, useRouter } from 'vue-router';

const route = useRoute();
const router = useRouter();


const props = defineProps({
  finshed: { type: Boolean, default: false },
  navbar: { type: Boolean, default: false },
  tabbar: { type: Boolean, default: false }
});

const emit = defineEmits(['refresh', 'load']);

//  上拉刷新
const onRefresh = () => {
  emit('refresh');
}

//  下拉加载
const onLoad = () => {
  emit('load');
}
</script>

<style lang="scss" scoped>
.contirner {
  display: flex;
  flex-direction: column;
  height: 100vw;
  height: 100vh;
  overflow: hidden;
  box-sizing: border-box;
}
</style>